/* Test semantic checking.  */

!ls
create table soaps(soapid  i, sname  c28, network  c4, rating  f);
create table stars(starid  i, stname  c20, plays  c12, soapid  i);

/* load tuples from ./tests/stars.data */
load soaps("../soaps.data");

/* print out contents of soaps */
print soaps;

/* build some indices on stars */
create index stars(starid);
create index stars(stname);

/* load tuples from ./tests/stars.data */
load stars("../stars.data");

print stars;
select * from stars;

select * from stars, soaps;

/* select * from starss, soaps; BAD rel */
/* select soaps.* from stars, soaps;  BAD \* */

select soaps.network, rating from stars, soaps;

/* select soapid from stars, soaps; AMB */

/* select * from soaps, soaps; DUP rel */

select soaps.network, rating from stars, soaps where soaps.soapid = stars.soapid;

/* select soaps.network, rating from stars, soaps where soaps.soapid = stars.plays; TYPE mismatch */
/* select soaps.network, rating from stars, soaps where soaps.soapid = sss; BAD relname */

print stars;

exit;
